package com.example.famhealing.schedule;

import com.example.famhealing.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;

public class SetWeightTemper extends Activity implements OnClickListener{
	
	ImageButton weightPlus;
	ImageButton weightMinus;
	ImageButton temperPlus;
	ImageButton temperMinus;
	EditText weightET;
	EditText temperET;
	
	public static double tempWeight = 45.0;
	public static double tempTemper = 38.0;
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_weighttemper);
          
          weightPlus = (ImageButton)findViewById(R.id.weightPlus);
          weightMinus = (ImageButton)findViewById(R.id.weightMinus);
          temperPlus = (ImageButton)findViewById(R.id.temperPlus);
          temperMinus = (ImageButton)findViewById(R.id.temperMinus);
          
          weightPlus.setOnClickListener(this);
          weightMinus.setOnClickListener(this);
          temperPlus.setOnClickListener(this);
          temperMinus.setOnClickListener(this);
          
          weightET = (EditText)findViewById(R.id.weight);
          temperET = (EditText)findViewById(R.id.temper);
         
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch(v.getId()) {
		case R.id.weightPlus :
			weightET.setText(Double.toString(tempWeight+0.1));
			tempWeight = tempWeight + 0.1;
			break;
		case R.id.weightMinus :
			weightET.setText(Double.toString(tempWeight-0.1));
			tempWeight = tempWeight - 0.1;
			break;
		case R.id.temperPlus :
			temperET.setText(Double.toString(tempTemper+0.1));
			tempWeight = tempWeight + 0.1;
			break;
		case R.id.temperMinus :
			temperET.setText(Double.toString(tempTemper-0.1));
			tempTemper = tempTemper - 0.1;
			break;
		}
		
	}
	
	@Override
    public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
    }


}
